package com.ganwei.mybatisplus.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

public class DatasourceConfig  {


    @Bean
    @Primary
    @ConfigurationProperties(prefix = "slave")
    public DataSource vxDataSource(){
        return DataSourceBuilder.create().build();
    }

    @Bean
    @ConfigurationProperties(prefix = "master")
    public DataSource crawlerDataSource(){
        return DataSourceBuilder.create().build();
    }
}
